package com.yxh.sse.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.yxh.sse.po.DicProfessionalCode;
import com.yxh.sse.po.DicSubjects;
import com.yxh.sse.service.SubjectSer;

public class SubjectAction extends ActionSupport {
	
	private SubjectSer subjectSer;

	
	public SubjectSer getSubjectSer() {
		return subjectSer;
	}

	public void setSubjectSer(SubjectSer subjectSer) {
		this.subjectSer = subjectSer;
	}

	public String execute(){
		
		String action=(String)ServletActionContext.getRequest().getParameter("action");
		
		if(action.equals("queryAll")){
			queryAll();
		}
		return "a";
	}

	private void queryAll() {
	
		List<DicProfessionalCode> list = subjectSer.queryAll();
		HttpServletRequest request = ServletActionContext.getRequest();
		request.setAttribute("DicProfessionalCode", list);
		
	}

	
}
